package MyApp.View.well
{
	import MyApp.Model.proxy.WellProxy;
	
	import components.well.ObservationRecord;
	
	import custom.pager.Pager;
	
	import mx.collections.ArrayCollection;
	
	import org.puremvc.as3.interfaces.INotification;
	import MyApp.View.CommonMediator;

	public class ObservationRecordMediator extends CommonMediator
	{
		public static const NAME:String="ObservationRecordMediator";
		public function ObservationRecordMediator(mediatorName:String=null, viewComponent:Object=null)
		{
			super(mediatorName, viewComponent);
			this.CommonRegister(view,view.record_list);
		}
		private function get view():ObservationRecord{
			return viewComponent as ObservationRecord;
		}
		override public function listNotificationInterests():Array{
			return [WellProxy.OBS_RECORD_LOAD_OK];
		}
		override public function handleNotification(notification:INotification):void{
			switch(notification.getName()){
				case WellProxy.OBS_RECORD_LOAD_OK:
					var obj:Object=notification.getBody();
					view.record_list.dataProvider=obj.data as ArrayCollection;
					view.record_list.mPager=obj.pager as Pager;
					break;
			}
		}
	}
}